<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3D Rotating Cube</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background-color: #1e1e1e;
      font-family: 'Arial', sans-serif;
    }

    .scene {
      width: 200px;
      height: 200px;
      perspective: 600px;
    }

    .cube {
      width: 100%;
      height: 100%;
      position: relative;
      transform-style: preserve-3d;
      transform: rotateX(-30deg) rotateY(-30deg);
      transition: transform 1s;
    }

    .scene:hover .cube {
      transform: rotateX(30deg) rotateY(180deg);
    }

    .cube-face {
      position: absolute;
      width: 200px;
      height: 200px;
      background-color: rgba(255, 255, 255, 0.8);
      border: 2px solid #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 24px;
      font-weight: bold;
      color: #333;
    }

    .cube-face:nth-child(1) { transform: rotateY(0deg) translateZ(100px); }
    .cube-face:nth-child(2) { transform: rotateY(90deg) translateZ(100px); }
    .cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(100px); }
    .cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(100px); }
    .cube-face:nth-child(5) { transform: rotateX(90deg) translateZ(100px); }
    .cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(100px); }

  </style>
</head>
<body>

  <div class="scene">
    <div class="cube">
      <div class="cube-face">1</div>
      <div class="cube-face">2</div>
      <div class="cube-face">3</div>
      <div class="cube-face">4</div>
      <div class="cube-face">5</div>
      <div class="cube-face">6</div>
    </div>
  </div>

</body>
</html>
